<?php  echo $this->session->flash();?>
 <script type="text/javascript">
      
</script>
 <div class="right-panel">
      <h3><?php __('SHOW_PERMISSIONS')?><span  class="back-align">
       <?php echo $this->html->link('<< '.__('BACK',true), array('controller'=>'users', 'action' => 'roles'), array('div' => false,'alt'=>'<< '.__('BACK',true),'title'=>'<< '.__('BACK',true) ,'class'=>'back-nav-black', 'escape' => false));?>
     </span></h3> 
     
      <div class="content-outer">
        <div class="top-btns">
	  <table width="100%" cellpadding="2" cellspacing="2" border="0">
	     <tr>
		     <td width="15%" align="right"><b><?php echo __('CATEGORY');?>:<b></td>
		     
		     <?php
		     $permissionArrayModule = array();
		     foreach($permissionArray as $data){
			 
			 if($data['SystemModule']['group'] == 'home'){
			      $permissionArrayModule[] = 'home';
			 }elseif($data['SystemModule']['group'] == 'work_flow'){
			      $permissionArrayModule[] = 'work_flow';
			 }elseif($data['SystemModule']['group'] == 'finance_control'){
			      $permissionArrayModule[] = 'finance_control';
			 }elseif($data['SystemModule']['group'] == 'system_admin'){
			      $permissionArrayModule[] = 'system_admin';
			 }elseif($data['SystemModule']['group'] == 'admin_control'){
			      $permissionArrayModule[] = 'admin_control';
			 }
		     }
		     
		    if(in_array("home", $permissionArrayModule)){
			$categoryName = 'HOME';
			echo '<td  align="left">';
			echo $this->Js->link(__($categoryName, true),array( 'controller' => 'users', 'action' => 'showcategory','home',$roleId),array('update' =>'#moduleListDiv','indicator' => 'loaderID','class'=>'link_red','alt'=>__('SHOW_MODULE_LIST', true)),'');
			
			echo '</td>';
		    }
		    
		    if(in_array("work_flow", $permissionArrayModule)){
			$categoryName = 'WORK_FLOW';
			echo '<td  align="left">';
			echo $this->Js->link(__($categoryName, true),array( 'controller' => 'users', 'action' => 'showcategory','work_flow',$roleId),array('update' =>'#moduleListDiv','indicator' => 'loaderID','class'=>'link_red','alt'=>__('SHOW_MODULE_LIST', true)),'');
			
			echo '</td>';
		    }
		    
		    if(in_array("finance_control", $permissionArrayModule)){
			$categoryName = 'FINANCE_CONTROL';
			echo '<td  align="left">';
			echo $this->Js->link(__($categoryName, true),array( 'controller' => 'users', 'action' => 'showcategory','finance_control',$roleId),array('update' =>'#moduleListDiv','indicator' => 'loaderID','class'=>'link_red','alt'=>__('SHOW_MODULE_LIST', true)),'');
			
			echo '</td>';
		    }
		    
		    if(in_array("admin_control", $permissionArrayModule)){
			$categoryName = 'ADMIN_CONTROL';
			echo '<td  align="left">';
			echo $this->Js->link(__($categoryName, true),array( 'controller' => 'users', 'action' => 'showcategory','admin_control',$roleId),array('update' =>'#moduleListDiv','indicator' => 'loaderID','class'=>'link_red','alt'=>__('SHOW_MODULE_LIST', true)),'');
			
			echo '</td>';
		    }
		    
		    if(in_array("system_admin", $permissionArrayModule)){
			$categoryName = 'SYSTEM_ADMIN';
			echo '<td  align="left">';
			echo $this->Js->link(__($categoryName, true),array( 'controller' => 'users', 'action' => 'showcategory','system_admin',$roleId),array('update' =>'#moduleListDiv','indicator' => 'loaderID','class'=>'link_red','alt'=>__('SHOW_MODULE_LIST', true)),'');
			
			echo '</td>';
		    }
		     ?>
	     </tr>
	 </table>
        </div>
        <!-- Div update starts here -->
          <div id="moduleListDiv" class="data-list">

          </div>
          <!-- Div update ends here -->
	  
	  
	  
           </div>
      <!--content-outer End-->
    </div>
<?php echo $this->Js->writeBuffer(); // Write cached scripts?>